
Page({
  /**
   * 页面的初始数据
   */
  data: {
    UserImage: '',
    Username: '',
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var _this = this
    wx.getUserInfo({
      success: function (res) {
        // localStorage.setItem('userInfo', res.userInfo)
        wx.setStorageSync("userInfo", res.userInfo)
        console.log(res)
        _this.setData({
          UserImage: res.userInfo.avatarUrl,
          Username: res.userInfo.nickName
        })
      }
    });
  },
  
  clickPhoto: function () {
    wx.chooseImage({
      count: 1,
      sizeType: ['compressed'],
      success: function (res) {
        wx.navigateTo({ url: '/pages/home/imgcut?imgpage=' + res.tempFilePaths[0] });
      }
    });
  },
  eimgcutcb: function (newimg) {
    console.log(newimg)
    this.setData({
      newimg: newimg
    });
  }
})